#include <stdio.h>
#include <pthread.h>
#define BUFFER_SIZE 16 //
#include "circlebuff.h"


extern DATAS_BUFF_T   comBuff0; 
void msgDisPatcherTreat(void);

void *msgDisPatcherThread(void)
 {
	 
	 while (1)
	 {
		 pthread_mutex_lock(&comBuff0.lock);
		// pthread_cond_wait(&comBuff0.newPacketFlag, &comBuff0.lock);
		 if(comBuff0.packetSum !=0)
		 {

			if(RecvBuff4treat.packetSum != 0) return 0;
			AP_circleBuff_ReadPacketData();
			if(comBuff0.packetSum>0)comBuff0.packetSum--;
		 }
		 pthread_mutex_unlock(&comBuff0.lock);
		 usleep(1000);
	 }
	 return NULL;
 }
